package com.nchu.ft.controller;


import com.nchu.ft.common.domain.ApiResult;
import com.nchu.ft.entity.FemaleMember;
import com.nchu.ft.service.FemaleMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName: FemaleMemberController
 * @description:
 * @Author: Chuanwei Li
 * @CreateTime: 2025-08-17 15:54
 * @Version: 1.0
 */
@RestController
@RequestMapping("/femaleMember")
public class FemaleMemberController {
    @Autowired
    private FemaleMemberService<FemaleMember> femaleMemberService;

    @PostMapping("/addFemaleMember")
    public ApiResult<Boolean> addFemaleMember(FemaleMember femaleMember) {
        return ApiResult.success(femaleMemberService.save(femaleMember));
    }

    @PostMapping("/updateFemaleMember")
    public ApiResult<Boolean> updateFemaleMember(FemaleMember femaleMember) {
        return ApiResult.success(femaleMemberService.updateById(femaleMember));
    }

    @PostMapping("/deleteFemaleMember")
    public ApiResult<Boolean> deleteFemaleMember(Integer id) {
        return ApiResult.success(femaleMemberService.removeById(id));
    }

    @GetMapping("/getFemaleMemberById")
    public ApiResult<FemaleMember> getFemaleMember(@RequestParam("femaleMemberId") Integer femaleMemberId) {
        return ApiResult.success(femaleMemberService.getById(femaleMemberId));
    }

    @GetMapping("/getFemaleMemberList")
    public ApiResult<List<FemaleMember>> getFemaleMemberList() {
        return ApiResult.success(femaleMemberService.list());
    }
}
